import javax.swing.*;
import java.awt.*;

public class Swing_ extends JFrame {
    panel panel = new panel();
    Swing_(){
        add(panel.north(),BorderLayout.NORTH);
        add(panel.east(),BorderLayout.EAST);
        add(panel.west(),BorderLayout.WEST);
        add(panel.south(),BorderLayout.SOUTH);
        setBounds(100,200,400,500);
        setAlwaysOnTop(true);
        setVisible(true);
        setResizable(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(new BorderLayout());

    }
}


class panel extends JPanel{
    JPanel north(){
        JPanel panel0 = new JPanel();
        JLabel label = new JLabel("姓名:");
        panel0.add(label);

        JTextField field = new JTextField();
        panel0.add(field);

        field.setColumns(10);
        JButton sure = new JButton("确定");
        JButton cancel = new JButton("取消");
        setBackground(Color.GRAY);

        panel0.setBackground(Color.GRAY);
        panel0.add(sure);
        panel0.add(cancel);

        return panel0;
    }

    JPanel south(){
        JPanel panel2 = new JPanel();

        JLabel label = new JLabel("你的学历:");
        JLabel sexT = new JLabel("性别:");
        panel2.add(label);

        ButtonGroup study = new ButtonGroup();
        JRadioButton pro = new JRadioButton("博士");
        JRadioButton plus = new JRadioButton("硕士");
        JRadioButton mini = new JRadioButton("学士");

        ButtonGroup sex = new ButtonGroup();
        JRadioButton femail = new JRadioButton("男");
        JRadioButton mail = new JRadioButton("女");

        study.add(pro);
        study.add(plus);
        study.add(mini);

        sex.add(femail);
        sex.add(mail);

        panel2.add(pro);
        panel2.add(plus);
        panel2.add(mini);

        panel2.add(sexT);
        panel2.add(femail);
        panel2.add(mail);
        panel2.setBackground(Color.GRAY);

        return panel2;
    }

    JPanel west(){
        JPanel panel1 = new JPanel();

        JLabel label = new JLabel("西");
        panel1.setBackground(Color.GRAY);
        panel1.add(label);
        panel1.setLayout(new BoxLayout(panel1,BoxLayout.LINE_AXIS));
        return panel1;
    }

    JPanel east(){
        JPanel panel3 = new JPanel();

        JLabel label = new JLabel("东");
        panel3.add(label);
        panel3.setBackground(Color.GRAY);
        panel3.setLayout(new BoxLayout(panel3,BoxLayout.LINE_AXIS));

        return panel3;
    }
}

class test{
    public static void main(String[] args) {
        new Swing_();
    }
}